package main

import (
	"bookkeeping-gin/bootstrap"
	"bookkeeping-gin/global"
)

//	@title			Bookkeeping API
//	@version		1.0
//	@description	This is Bookkeeping API documentation v1.0.

//	@host		localhost:8086
//	@BasePath	/api/v1

//	@securityDefinitions.apikey	JWT
//	@in							header
//	@name						Authorization
//	@description				get access_token from /api/v1/user/login format: Bearer token
func main() {
	// init config
	bootstrap.InitConfig()

	// init log
	bootstrap.InitLog()

	// init db
	bootstrap.InitDB()
	defer func() {
		if global.App.DB != nil {
			db, _ := global.App.DB.DB()
			_ = db.Close()
		}
	}()

	// init validator
	bootstrap.InitValidator()

	// init redis
	bootstrap.InitRedis()

	//// run server
	bootstrap.RunServer()
}
